var m_login = {};

m_login.ids = ['user_login_name', 'user_login_password', 'code'];
m_login.code = "";

m_login.getImage = function() {
	var url = "";
	var reqData = {};
	var req = new common.Request();
	req.sendRequest(url, data, function(e){
		if (e != null && e.isSuccess) {
			
		}
	}, function(e) {
		
	});
}

m_login.clickInit = function() {
	//为按钮绑定单击事件-->点击登陆提交form表单
	$("#user_login_btn").click(function(){
		sbm();
		return false;
	});
	//为键盘回车绑定登录事件-->回车提交form表单
	$(document).on("keydown",function(e){
		if(e.keyCode == 13){
			sbm();
		}
	});
	//封装登录验证方法
	function sbm(){
		var ver = new verify.login(m_login.ids, 'empty_style', function(){
			var req = new common.Request();
			var reqData = {};
			reqData['name'] = $('#user_login_name').val();
			reqData['pass'] = $('#user_login_password').val();
			var url = "../managerInfo/login.action";
			req.sendMethodRequest("get", url, reqData, function(e){
				if (e != null && e.isSuccess) {
					window.location = "index.html?role=" + e.msg;
				}
			}, function(e){
				
			});
		}, function(){
			
		});
	};
}

m_login.init = function() {
	m_login.clickInit();
	//m_login.getImage();
}

$(document).ready(function() {
	m_login.init();
});